<?php
/*
*	Copyright 2011
*
*	commerce-seo.de
*
*/

require('includes/application_top.php');

$q = strtolower($_GET["q"]);
if(!$q)
	return;

	$items_query = xtDBquery("SELECT 
									pd.products_name, 
									p.products_image
								FROM  
									".TABLE_PRODUCTS_DESCRIPTION." pd, 
									".TABLE_PRODUCTS." p
								WHERE 
									pd.products_name like('%" . xtc_db_input($_GET['q']) . "%')
								AND 
									pd.products_id = p.products_id
								AND 
									p.products_status = '1'
								AND 
									language_id = '".(int) $_SESSION['languages_id']."'
									".$fsk_lock.$group_check."  
								LIMIT 20");        
								
while($items_value = xtc_db_fetch_array($items_query))
	$items[] .= "<img src=".DIR_WS_THUMBNAIL_IMAGES.$items_value['products_image']." />".$items_value['products_name']."\n";

if($items == '') 
	$items = array();


$items = array_unique($items);

foreach ($items AS $item)
	echo $item."\n";

?> 
